home *** CD-ROM | disk | FTP | other *** search
- Path: news.sprintlink.net!datalytics!news
- From: Rob Stewart <stew@datalytics.com>
- Newsgroups: comp.lang.c++
- Subject: Re: Visual C++ and the new operator
- Date: 4 Jan 1996 17:13:55 GMT
- Organization: Datalytics, Inc
- Message-ID: <4ch1sj$ldg@gold.datalytics.com>
- References: <4bq0fr$clp@zoom2.telepath.com>
- NNTP-Posting-Host: pc071.datalytics.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.22 (Windows; I; 32bit)
-
- aslan@soonernet.com (Merciless) wrote:
- >Argh!
- >
- [snip]
- >One of the examples uses two new operators: new and delete,
- >to replace (sort of) malloc and dealloc.
-
- Not "sort of." They should completely replace calls to malloc
- and free (what's "dealloc?"). In addition to allocating and
- freeing memory, new and delete invoke constructors and
- destructors, respectively. This is a tremendous boon.
-
- >Well good, any thing that
- >make dynamic memory allocation easier is a GoodThing(tm) in
- >my book
-
- They definitely make heap management easier. On the other
- hand, you're still using pointers and the heap, so you can
- still get in trouble with them.
-
- >BUT
- >
- >Whenever I try to link code that contain new and delete
- >I get:
- >
- >c:\msvc\mfc\lib\mafxcwd.lib(appinit.cpp) :
- >error L2029: 'GETFILETITLE' : unresolved external
- [snip]
- >c:\msvc\mfc\lib\mafxcwd.lib(dlgclr.cpp) :
- >error L2029: 'CHOOSECOLOR' : unresolved external
- >
- >
- >If I remove new and delete (make the allocations static at
- >compile time) this links just swell.
- >
- [snip]
- >
- >-Ian Payne
- > aslan@soonernet.com
- >
-
- The identifiers the linker can't find look like yours. Post
- the offending code and I'll see what I can tell you.
-
- --
- Robert Stewart | My opinions are usually my own.
- Datalytics, Inc.
- (513)226-7700
- stew@datalytics.com
-
-
-